<!--参与率排行榜预览模块-->
<template>
  <div
    class="item-listOfPeople item-content"
    :style="{ fontSize: adaptiveFontSize(fontSize), color: fontColor, fontWeight, fontFamily }"
  >
    <div class="listOfPeople-th">
      <div class="th-item">名次</div>
      <div class="th-item">单位名称</div>
      <div class="th-item">参与率</div>
    </div>
    <div class="listOfPeople-tr" v-for="(item, index) in COMPANY_NAME" :key="index">
      <div class="th-item">{{ index + 1 }}</div>
      <div class="th-item">{{ item }}</div>
      <div class="th-item">100%</div>
    </div>
  </div>
</template>

<script setup>
import { COMPANY_NAME, DEVICE_TYPE, SCALE_CONFIGURATION } from "@/utils/mockConfiguration/mockConfig";
import { toRefs } from "vue";
const props = defineProps({
  terminalType: {
    type: String,
    required: true,
    default: DEVICE_TYPE.DESKTOP, //DESKTOP:pc端,MOBILE:移动端
  },
});

const { fontFamily, fontWeight, fontColor, fontSize } = toRefs(cssStyle.value);

/**
 * 适配字体
 */
const adaptiveFontSize = computed(() => value => `${value * SCALE_CONFIGURATION[props.terminalType]}rem`);
</script>

<style lang="less" scoped>
.item-listOfPeople {
  margin-top: 20px;
  display: inline-block;
  .listOfPeople-th {
    font-weight: 700;
  }
  .listOfPeople-th,
  .listOfPeople-tr {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
  }
}
</style>
